package com.guagua.chat.statistics;
/**
 * 北京八度互联科技有限公司版权所有
 * Copyright (C) Badu Corporation. All Rights Reserved
 */
import java.util.Calendar;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
/**
 * Quartz 定时任务
 * 每月执行
 * @author liyi 
 *
 */
public class StatisticsTaskByMonth implements Job{

	@Override
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		Calendar calendar = Calendar.getInstance();
		calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
		calendar.add(Calendar.MONTH, -1);//上个月
		int year = calendar.get(Calendar.YEAR);
		int month = calendar.get(Calendar.MONTH)+1;
		System.out.println("year = "+year);
		System.out.println("month = "+month);
		new StatisticsDao().execStatisticsByMonth(year, month);
		
	}

}
